<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>GeoExt.plugins.PrintExtent &mdash; GeoExt v1.1</title>
    <link rel="stylesheet" href="../../../_static/geoext.css" type="text/css" />
    <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../../',
        VERSION:     '1.1',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../../_static/doctools.js"></script>
    <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
    <link rel="top" title="GeoExt v1.1" href="../../../index.html" />
    <link rel="up" title="GeoExt.plugins" href="../plugins.html" />
    <link rel="next" title="GeoExt.plugins.PrintPageField" href="PrintPageField.html" />
    <link rel="prev" title="GeoExt.plugins.AttributeForm" href="AttributeForm.html" />
    
    
    
    
    

  </head>
  <body>
    <div class="header">
        <div class="wrap">
            <h1 id="logo"><a href="../../../index.html">GeoExt</a></h1>
            <ul id="top-nav">
                <li class="first"><a href="../../../docs.html">Documentation</a></li>
                <li><a href="../../../examples.html">Examples</a></li>
                <li><a href="../../../downloads.html">Download</a></li>
                <li><a href="http://trac.geoext.org/">Development</a></li>
            </ul>
            <div id="searchbox">
                <form class="search" action="../../../search.html" method="get">
                    <input id="searchbox-query" type="text" name="q" size="25" value="Search &hellip;" tabindex="3" onblur="if(this.value=='') this.value='Search &hellip;';" onfocus="if(this.value=='Search &hellip;') this.value='';" />
                    <input id="searchbox-submit" type="image" value="Search" src="../../../_static/img/search_icon_green.png" />
                    <input type="hidden" name="check_keywords" value="yes" />
                    <input type="hidden" name="area" value="default" />
                </form>
            </div>
        </div>
    </div>

    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li><a href="../../../index.html">GeoExt</a> &raquo;</li>
          <li><a href="../../index.html" >API Reference</a> &raquo;</li>
          <li><a href="../plugins.html" accesskey="U"><tt class="docutils literal docutils literal docutils literal docutils literal docutils literal"><span class="pre">GeoExt.plugins</span></tt></a> &raquo;</li>
        <li><a href="#"><tt class="docutils literal docutils literal"><span class="pre">GeoExt.plugins.PrintExtent</span></tt></a></li>
      </ul>
    </div>

      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <h3><a href="../../../index.html">Table Of Contents</a></h3>
            <ul>
<li><a class="reference external" href="#"><tt class="docutils literal"><span class="pre">GeoExt.plugins.PrintExtent</span></tt></a><ul>
<li><a class="reference external" href="#example-use">Example Use</a></li>
<li><a class="reference external" href="#config-options">Config Options</a></li>
<li><a class="reference external" href="#public-properties">Public Properties</a></li>
<li><a class="reference external" href="#public-methods">Public Methods</a></li>
<li><a class="reference external" href="#events">Events</a></li>
</ul>
</li>
</ul>

            <h4>Previous topic</h4>
            <p class="topless"><a href="AttributeForm.html"
                                  title="previous chapter"><tt class="docutils literal docutils literal docutils literal"><span class="pre">GeoExt.plugins.AttributeForm</span></tt></a></p>
            <h4>Next topic</h4>
            <p class="topless"><a href="PrintPageField.html"
                                  title="next chapter"><tt class="docutils literal"><span class="pre">GeoExt.plugins.PrintPageField</span></tt></a></p>
        </div>
      </div>


    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="geoext-plugins-printextent">
<h1><a title="GeoExt.plugins.PrintExtent" class="reference internal" href="#GeoExt.plugins.PrintExtent"><tt class="xref docutils literal"><span class="pre">GeoExt.plugins.PrintExtent</span></tt></a><a class="headerlink" href="#geoext-plugins-printextent" title="Permalink to this headline">¶</a></h1>
<dl class="meta docutils">
<dt>ptype</dt>
<dd><tt class="docutils literal"><span class="pre">gx_printextent</span></tt></dd>
</dl>
<dl class="class">
<dt id="GeoExt.plugins.PrintExtent">
<em class="property">class </em><tt class="descclassname">GeoExt.plugins.</tt><tt class="descname">PrintExtent</tt><a class="headerlink" href="#GeoExt.plugins.PrintExtent" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>Provides a way to show and modify the extents of print pages on the map. It
uses a layer to render the page extent and handle features of print pages,
and provides a control to modify them. Must be set as a plugin to a
<a title="GeoExt.MapPanel" class="reference external" href="../widgets/MapPanel.html#GeoExt.MapPanel"><tt class="xref docutils literal"><span class="pre">GeoExt.MapPanel</span></tt></a>.</p>
<div class="section" id="example-use">
<h2>Example Use<a class="headerlink" href="#example-use" title="Permalink to this headline">¶</a></h2>
<p>Sample code to create a MapPanel with a PrintExtent, and print it
immediately:</p>
<div class="highlight-javascript"><div class="highlight"><pre><span class="kd">var</span> <span class="nx">printExtent</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">plugins</span><span class="p">.</span><span class="nx">PrintExtent</span><span class="p">({</span>
    <span class="nx">printProvider</span><span class="o">:</span> <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">data</span><span class="p">.</span><span class="nx">PrintProvider</span><span class="p">({</span>
        <span class="nx">capabilities</span><span class="o">:</span> <span class="nx">printCapabilities</span>
    <span class="p">})</span>
<span class="p">});</span>

<span class="kd">var</span> <span class="nx">mapPanel</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">MapPanel</span><span class="p">({</span>
    <span class="nx">border</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span>
    <span class="nx">renderTo</span><span class="o">:</span> <span class="s2">&quot;div-id&quot;</span><span class="p">,</span>
    <span class="nx">layers</span><span class="o">:</span> <span class="p">[</span><span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Layer</span><span class="p">.</span><span class="nx">WMS</span><span class="p">(</span><span class="s2">&quot;Tasmania&quot;</span><span class="p">,</span> <span class="s2">&quot;http://demo.opengeo.org/geoserver/wms&quot;</span><span class="p">,</span>
        <span class="p">{</span><span class="nx">layers</span><span class="o">:</span> <span class="s2">&quot;topp:tasmania_state_boundaries&quot;</span><span class="p">},</span> <span class="p">{</span><span class="nx">singleTile</span><span class="o">:</span> <span class="kc">true</span><span class="p">})],</span>
    <span class="nx">center</span><span class="o">:</span> <span class="p">[</span><span class="mf">146.56</span><span class="p">,</span> <span class="o">-</span><span class="mf">41.56</span><span class="p">],</span>
    <span class="nx">zoom</span><span class="o">:</span> <span class="mi">6</span><span class="p">,</span>
    <span class="nx">plugins</span><span class="o">:</span> <span class="nx">printExtent</span>
<span class="p">});</span>

<span class="nx">printExtent</span><span class="p">.</span><span class="nx">addPage</span><span class="p">();</span>

<span class="c1">// print the map</span>
<span class="nx">printExtent</span><span class="p">.</span><span class="nx">print</span><span class="p">();</span>
</pre></div>
</div>
</div>
<div class="section" id="config-options">
<h2>Config Options<a class="headerlink" href="#config-options" title="Permalink to this headline">¶</a></h2>
<p>Configuration properties.</p>
<dl class="describe">
<dt>
<tt class="descname">layer</tt></dt>
<dd><tt class="docutils literal"><span class="pre">OpenLayers.Layer.Vector</span></tt> The layer used to render extent and handle
features to. Optional, will be created if not provided.</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">pages</tt></dt>
<dd><p>Array of <a title="GeoExt.data.PrintPage" class="reference external" href="../data/PrintPage.html#GeoExt.data.PrintPage"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintPage</span></tt></a> The pages that this plugin
controls. Optional. If not provided, it will be created with one page
that is completely contained within the visible map extent.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">All pages must use the same PrintProvider.</p>
</div>
</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">printProvider</tt></dt>
<dd><a title="GeoExt.data.PrintProvider" class="reference external" href="../data/PrintProvider.html#GeoExt.data.PrintProvider"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintProvider</span></tt></a> The print provider this form
is connected to. Optional if pages are provided.</dd></dl>

</div>
<div class="section" id="public-properties">
<h2>Public Properties<a class="headerlink" href="#public-properties" title="Permalink to this headline">¶</a></h2>
<p>Public properties.</p>
<dl class="attribute">
<dt id="GeoExt.plugins.PrintExtent.page">
<tt class="descclassname">PrintExtent.</tt><tt class="descname">page</tt><a class="headerlink" href="#GeoExt.plugins.PrintExtent.page" title="Permalink to this definition">¶</a></dt>
<dd><a title="GeoExt.data.PrintPage" class="reference external" href="../data/PrintPage.html#GeoExt.data.PrintPage"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintPage</span></tt></a> The page currently set for
transformation.</dd></dl>

<dl class="attribute">
<dt id="GeoExt.plugins.PrintExtent.pages">
<tt class="descclassname">PrintExtent.</tt><tt class="descname">pages</tt><a class="headerlink" href="#GeoExt.plugins.PrintExtent.pages" title="Permalink to this definition">¶</a></dt>
<dd>Array of <a title="GeoExt.data.PrintPage" class="reference external" href="../data/PrintPage.html#GeoExt.data.PrintPage"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintPage</span></tt></a> The pages that this component
controls. Read-only.</dd></dl>

<dl class="attribute">
<dt id="GeoExt.plugins.PrintExtent.printProvider">
<tt class="descclassname">PrintExtent.</tt><tt class="descname">printProvider</tt><a class="headerlink" href="#GeoExt.plugins.PrintExtent.printProvider" title="Permalink to this definition">¶</a></dt>
<dd><a title="GeoExt.data.PrintProvider" class="reference external" href="../data/PrintProvider.html#GeoExt.data.PrintProvider"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintProvider</span></tt></a> The print provider this form
is connected to. Read-only.</dd></dl>

</div>
<div class="section" id="public-methods">
<h2>Public Methods<a class="headerlink" href="#public-methods" title="Permalink to this headline">¶</a></h2>
<p>Public methods.</p>
<dl class="method">
<dt id="GeoExt.plugins.PrintExtent.addPage">
<tt class="descclassname">PrintExtent.</tt><tt class="descname">addPage</tt><big>(</big><big>)</big><a class="headerlink" href="#GeoExt.plugins.PrintExtent.addPage" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameter:</th><td class="field-body"><em>page</em> &#8211; <a title="GeoExt.data.PrintPage" class="reference external" href="../data/PrintPage.html#GeoExt.data.PrintPage"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintPage</span></tt></a> The page to add
to this plugin. If not provided, a page that fits the current
extent is created.</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">page :class:<tt class="docutils literal"><span class="pre">GeoExt.data.PrintPage</span></tt></td>
</tr>
</tbody>
</table>
<p>Adds a page to the list of pages that this plugin controls.</p>
</dd></dl>

<dl class="method">
<dt id="GeoExt.plugins.PrintExtent.hide">
<tt class="descclassname">PrintExtent.</tt><tt class="descname">hide</tt><big>(</big><big>)</big><a class="headerlink" href="#GeoExt.plugins.PrintExtent.hide" title="Permalink to this definition">¶</a></dt>
<dd>Tear downs the plugin, removing the
<tt class="docutils literal"><span class="pre">OpenLayers.Control.TransformFeature</span></tt> control and
the <tt class="docutils literal"><span class="pre">OpenLayers.Layer.Vector</span></tt> layer.</dd></dl>

<dl class="method">
<dt id="GeoExt.plugins.PrintExtent.print">
<tt class="descclassname">PrintExtent.</tt><tt class="descname">print</tt><big>(</big><big>)</big><a class="headerlink" href="#GeoExt.plugins.PrintExtent.print" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameter:</th><td class="field-body"><em>options</em> &#8211; <tt class="docutils literal"><span class="pre">Object</span></tt> Options to send to the PrintProvider&#8217;s
print method. See <a title="GeoExt.data.PrintProvider" class="reference external" href="../data/PrintProvider.html#GeoExt.data.PrintProvider"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintProvider</span></tt></a> :: <tt class="docutils literal"><span class="pre">print</span></tt>.</td>
</tr>
</tbody>
</table>
<p>Prints all pages as shown on the map.</p>
</dd></dl>

<dl class="method">
<dt id="GeoExt.plugins.PrintExtent.removePage">
<tt class="descclassname">PrintExtent.</tt><tt class="descname">removePage</tt><big>(</big><big>)</big><a class="headerlink" href="#GeoExt.plugins.PrintExtent.removePage" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameter:</th><td class="field-body"><em>page</em> &#8211; <a title="GeoExt.data.PrintPage" class="reference external" href="../data/PrintPage.html#GeoExt.data.PrintPage"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintPage</span></tt></a> The page to remove
from this plugin.</td>
</tr>
</tbody>
</table>
<p>Removes a page from the list of pages that this plugin controls.</p>
</dd></dl>

<dl class="method">
<dt id="GeoExt.plugins.PrintExtent.selectPage">
<tt class="descclassname">PrintExtent.</tt><tt class="descname">selectPage</tt><big>(</big><big>)</big><a class="headerlink" href="#GeoExt.plugins.PrintExtent.selectPage" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameter:</th><td class="field-body"><em>page</em> &#8211; <a title="GeoExt.data.PrintPage" class="reference external" href="../data/PrintPage.html#GeoExt.data.PrintPage"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintPage</span></tt></a> The page to select</td>
</tr>
</tbody>
</table>
<p>Selects the given page (ie. calls the setFeature on the modify feature
control)</p>
</dd></dl>

<dl class="method">
<dt id="GeoExt.plugins.PrintExtent.show">
<tt class="descclassname">PrintExtent.</tt><tt class="descname">show</tt><big>(</big><big>)</big><a class="headerlink" href="#GeoExt.plugins.PrintExtent.show" title="Permalink to this definition">¶</a></dt>
<dd>Sets up the plugin, initializing the <tt class="docutils literal"><span class="pre">OpenLayers.Layer.Vector</span></tt>
layer and <tt class="docutils literal"><span class="pre">OpenLayers.Control.TransformFeature</span></tt>, and centering
the first page if no pages were specified in the configuration.</dd></dl>

</div>
<div class="section" id="events">
<h2>Events<a class="headerlink" href="#events" title="Permalink to this headline">¶</a></h2>
<p>Events.</p>
<dl class="describe">
<dt>
<tt class="descname">selectpage</tt></dt>
<dd><p>Triggered when a page has been selected using the control</p>
<p>Listener arguments:
* printPage - <a title="GeoExt.data.PrintPage" class="reference external" href="../data/PrintPage.html#GeoExt.data.PrintPage"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintPage</span></tt></a> this printPage</p>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
            <li class="right" style="margin-right: 10px">
              <a href="../../../genindex.html" title="General Index"
                 accesskey="I">index</a></li>
            <li class="right" >
              <a href="../../../modindex.html" title="Global Module Index"
                 accesskey="M">modules</a> |</li>
            <li class="right" >
              <a href="PrintPageField.html" title="GeoExt.plugins.PrintPageField"
                 accesskey="N">next</a> |</li>
            <li class="right" >
              <a href="AttributeForm.html" title="GeoExt.plugins.AttributeForm"
                 accesskey="P">previous</a> |</li>
        <li><a href="../../../index.html">GeoExt</a> &raquo;</li>
          <li><a href="../../index.html" >API Reference</a> &raquo;</li>
          <li><a href="../plugins.html" ><tt class="docutils literal docutils literal docutils literal docutils literal docutils literal"><span class="pre">GeoExt.plugins</span></tt></a> &raquo;</li>
        <li><a href="#"><tt class="docutils literal docutils literal"><span class="pre">GeoExt.plugins.PrintExtent</span></tt></a></li>
      </ul>
    </div>

    <div class="footer">
      &copy; Copyright 2009-2010, GeoExt Community.
    </div>
  </body>
</html>